﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Wypozyczalnia.Controllers;



namespace Wypozyczalnia.Testy
{
    [TestClass]
    public class WypozyczalniaControllerTest
    {
        [TestMethod]
        public void TestDetailsView() 
        {
            
            var controller = new WypozyczalniaController(); 
            var result = controller.Details(2) as ViewResult; 
            Assert.AreEqual("Details", result.ViewName); 
        }

        [TestMethod]
        public void TestDetailsRedirect() 
        {
            var controller = new WypozyczalniaController();
            var result = (RedirectToRouteResult)controller.Details(-1); 
            Assert.AreEqual("Index", result.RouteValues["action"]);
        }
    }
}